import { Commit } from 'vuex'
const getters = {}
const state = {
  newCode: {},
  groupId: [],
  lookList: {},
  posterType: null
}
const mutations = {
  ALL_GROUP_ID: (state: any, data: any) => {
    state.groupId = data
  },
  BASIC_DATA: (state: any, data: any) => {
    state.newCode = { ...data }
  },
  BASIC_SETTING: (state: any, data: any) => {
    state.newCode = { ...state.newCode, ...data }
  },
  LOOK_DATA: (state: any, data: any) => {
    state.lookList = data
  },
  DIS_POSTER: (state: any, data: any) => {
    console.log(data, "数据")
    state.posterType = data
  }
}
const actions = {
  allGroupId: (context: { commit: Commit }, data: any) => {
    context.commit('ALL_GROUP_ID', data)
  },
  basicData: (context: { commit: Commit }, data: any) => {
    context.commit('BASIC_DATA', data)
  },
  basicSetting: (context: { commit: Commit }, data: any) => {
    context.commit('BASIC_SETTING', data)
  },
  lookData: (context: { commit: Commit }, data: any) => {
    context.commit('LOOK_DATA', data)
  },
  dataProcessing: (context: { commit: Commit}, data:any) => {
    context.commit('DATA_PROCESSING', data)
  }
}
export default {
  namespaced: true,
  getters,
  state,
  mutations,
  actions
}
